package cate.game.rank.cross.h;


import cate.common.table.d.GDRank;
import cate.game.GameBody;
import cate.game.pvp.championrace.data.ChampionRaceRank;
import cate.game.pvp.championrace.dto.ChampionRaceRankListData;
import cate.game.rank.h.IRankFuncHandler;
import cate.game.rank.vo.RankParam;
import cate.game.role.Role;
import easy.java.practice.errorcode.EcResult;

import java.util.Collections;
import java.util.List;

public class ChampionRaceRankLoader implements IRankFuncHandler<ChampionRaceRank> {
    private GameBody gameBody;

    public void initialize(GameBody gameBody) {
        this.gameBody = gameBody;
        gameBody.rank.registeHandler(this);
    }

    @Override
    public int getRankId() {
        return GDRank.Id.CHAMPION_RACE_RANK_ID;
    }

    @Override
    public ChampionRaceRank getRankOneData(RankParam param) {
        return null;
    }

    @Override
    public EcResult<Void> admire(RankParam param, String roleUid, int rank) {
        return gameBody.pvp.championRace.getBizHandler().admire(roleUid, rank);
    }

    @Override
    public ChampionRaceRank getData(RankParam param, Role role) {
        return null;
    }

    @Override
    public List<ChampionRaceRank> getRankList(RankParam param) {
        ChampionRaceRankListData data = gameBody.pvp.championRace.getBizHandler().getRankList();
        return data == null ? Collections.emptyList() : data.list;
    }
}
